import {defineConfig} from 'vite'
import vue from '@vitejs/plugin-vue'
import * as path from "path";
import AutoImport from "unplugin-auto-import/vite";
import WindiCSS from 'vite-plugin-windicss'
import vueJsx from '@vitejs/plugin-vue-jsx'
// import VueDevTools from 'vite-plugin-vue-devtools'

const pathSrc = path.resolve(__dirname, 'src')
// https://vitejs.dev/config/
export default defineConfig({
    server: {
        host: '0.0.0.0',
        proxy: {
            // "/files": {
            //     target: "http://192.168.1.76:40030/",
            //     changeOrigin: true,
            //     rewrite: (path) => path.replace(/^\/files/, ""),
            // }
        }
    },
    resolve: {
        alias: {
            "@": pathSrc,
            'vue-i18n': 'vue-i18n/dist/vue-i18n.cjs.js'
        }
    },
    plugins: [
        // VueDevTools(),
        vue(),
        vueJsx(),
        WindiCSS(),
        AutoImport({
            ignore: ['h'],
            imports: [
                'vue',
                {
                    "lodash": [
                        ["*", "_"]
                    ]
                }
            ],
            dts: 'src/auto-imports.d.ts'
        })
    ]
})
